package com.study.demo.controller;

import com.study.demo.dto.User;
import com.study.demo.service.MyBatisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mybatis")
public class MybatisController {
    @Autowired
    private MyBatisService myBatisService;

    @GetMapping("/user")
    public User getUserByName(@RequestParam String name) {
        return myBatisService.getUserByName(name);
    }
}
